fix(nix): Wrap package binary to isolate Python environment#220
Merged
Conversation
When consumed as a buildInput in another flake's devShell, other Python-based packages (azure-cli, awscli2, pipx) pollute PYTHONPATH with python3.13 site-packages. deepwork's python3.11 interpreter then loads incompatible native extensions (e.g. cryptography built for 3.13), causing "undefined symbol: PyErr_GetRaisedException" on MCP server start. Wrap the deepwork binary with makeWrapper --unset PYTHONPATH to isolate it from the host Python environment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the Nix flake package output so deepwork runs with an isolated Python environment when used as a dependency in other flakes’ devShells, preventing incompatible PYTHONPATH leakage from other Python versions.
Changes:
- Wraps the
deepworkexecutable usingmakeWrapper --unset PYTHONPATHto avoid hostPYTHONPATHpollution. - Replaces the package output from a full
mkVirtualEnvresult to a minimal wrapper derivation exposing onlybin/deepwork. - Adds detailed inline documentation explaining the cross-Python native extension failure mode this addresses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When consumed as a buildInput in another flake's devShell, other Python-based packages (azure-cli, awscli2, pipx) pollute PYTHONPATH with python3.13 site-packages. deepwork's python3.11 interpreter then loads incompatible native extensions (e.g. cryptography built for 3.13), causing "undefined symbol: PyErr_GetRaisedException" on MCP server start.
Wrap the deepwork binary with makeWrapper --unset PYTHONPATH to isolate it from the host Python environment.